package com.ruoyi.logistic.service.impl;

import com.github.pagehelper.PageHelper;
import com.ruoyi.logistic.domain.NetworkHqPreMyAccount;
import com.ruoyi.logistic.domain.NetworkHqPrePayment;
import com.ruoyi.logistic.domain.PageDate;
import com.ruoyi.logistic.domain.vo.NetworkHqPrePaymentVo;
import com.ruoyi.logistic.mapper.NetworkHqPreMyAccountMapper;
import com.ruoyi.logistic.mapper.NetworkHqPrePaymentMapper;
import com.ruoyi.logistic.service.NetworkHqPrePaymentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class NetworkHqPrePaymentServiceImpl implements NetworkHqPrePaymentService {
    @Autowired
    private NetworkHqPrePaymentMapper networkHqPrePaymentMapper;
    @Autowired
    private NetworkHqPreMyAccountMapper networkHqPreMyAccountMapper;
    @Override
    public List<NetworkHqPrePayment> selectAll(PageDate pageDate) {
        PageHelper.startPage(pageDate);
        return networkHqPrePaymentMapper.selectAll();
    }

    @Override
    public Boolean insert(NetworkHqPrePayment networkHqPrePayment) {
        return networkHqPrePaymentMapper.insert(networkHqPrePayment);
    }

    @Override
    public Boolean update(NetworkHqPrePayment networkHqPrePayment) {
        return networkHqPrePaymentMapper.update(networkHqPrePayment);
    }

    @Override
    public Boolean deleteById(Integer id) {
        return networkHqPrePaymentMapper.deleteById(id);
    }

    @Override
    public List<NetworkHqPrePayment> search(NetworkHqPrePaymentVo networkHqPrePaymentVo) {
        PageHelper.startPage(networkHqPrePaymentVo.getPageDate());
        return networkHqPrePaymentMapper.search(networkHqPrePaymentVo);
    }

    @Override
    public List<NetworkHqPreMyAccount> myAccount(Integer networkNameId) {
        return networkHqPreMyAccountMapper.search(networkNameId);
    }
}
